package com.game.HUD;

import javax.microedition.khronos.opengles.GL10;

import object.obj2D.graphics.TexSquare;
import object.obj2D.graphics.Texture;
import object.obj3D.enemy.Teminator;
import system.Device;
import system.Graphics;
import MD2Model.Vector3;

import com.game.R;

public class ShowBackground {
	static private int m_texBackgroundID;
	static private TexSquare m_backgroundSquare;
	private static int m_iBackgroundSize = 64;
	private static GL10 gl;
	private static Texture m_texture;
	
	public static void Init()
	{

		gl = Graphics.GetGraphics();
		m_texture = new Texture();
		
	    float textures[] = {
	    		0, 0,	32, 0,
	    		32, 32,	0, 32
	    };
	    
	    Device.DisableScaleFactor();
		m_backgroundSquare = new TexSquare(m_iBackgroundSize, m_iBackgroundSize);
		Device.EnableScaleFactor();
		m_backgroundSquare.SetTexCoord(textures);
		
		m_texBackgroundID = m_texture.initTexture(R.drawable.g01);
	}
	
	public static void Render()
	{
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glPushMatrix();
		
		gl.glTranslatef(0f, -1f, 0f);
		gl.glRotatef(-90, 1.0f, 0, 0);
		m_texture.loadTexture(m_texBackgroundID);
		m_backgroundSquare.Render();
		
		gl.glPopMatrix();
	}
}
